<template>
  <div >
    <!-- Unnamed (个人中心左侧栏) -->
    <div style="margin-top: 90px; margin-left: -20px;float: left;">
      <el-menu class="el-menu-vertical" style="width: 150px;">
        <el-menu-item index="0" @click="handleClickToCenter()">
          <span>个人中心</span>
        </el-menu-item>
        <el-menu-item index="1" @click="handleClickCart()">
          <span>我的购物车</span>
        </el-menu-item>
        <el-menu-item index="2" @click="handleClickOrder()">
          <span>我的订单</span>
        </el-menu-item>
        <el-menu-item index="3" @click="handleClickToEvaluate()">
          <span>评价管理</span>
        </el-menu-item>
        <el-menu-item index="4" @click="handleClickToPIM()">
          <span>个人信息</span>
        </el-menu-item>
        <el-menu-item index="6" @click="handleClickSite()">
          <span>我的收货地址</span>
        </el-menu-item>
        <el-menu-item index="7" @click="handleClickTOCollection()">
          <span>我的收藏</span>
        </el-menu-item>
      </el-menu>
    </div>
    <div style="float: right;margin-top: 90px;margin-left: 30px">
      <router-view/>
    </div>
  </div>
</template>

<script>
export default {
  name: "PersonView",
  data() {
    return {
      accountName: '',
      phoneNumber: '',
    }
  },
  methods: {
    handleClickToCenter() {
      // 跳转到个人中心
      if (this.$route.path === '/center') {
        window.location.reload();
      } else {
        this.$router.push('/center');
      }
    },
    handleClickCart() {
      // 跳转到我的购物车
      if (this.$route.path === '/cart') {
        window.location.reload();
      } else {
        this.$router.push('/cart');
      }
    },
    handleClickOrder() {
      // 跳转到我的订单
      if (this.$route.path === '/order') {
        window.location.reload();
      } else {
        this.$router.push('/order');
      }
    },
    handleClickToEvaluate() {
      // 跳转到评价管理
      if (this.$route.path === '/evaluate') {
        window.location.reload();
      } else {
        this.$router.push('/evaluate');
      }
    },
    handleClickToPIM() {
      // 跳转到个人信息
      if (this.$route.path === '/pim') {
        window.location.reload();
      } else {
        this.$router.push('/pim');
      }
    },
    handleClickSite() {
      // 跳转到我的收货地址
      if (this.$route.path === '/site') {
        window.location.reload();
      } else {
        this.$router.push('/site');
      }
    },
    handleClickTOCollection() {
      // 跳转到我的收藏
      if (this.$route.path === '/collection') {
        window.location.reload();
      } else {
        this.$router.push('/collection');
      }
    },
  }
}
</script>

<style scoped>
.big-text {
  color: #ff6e90;
  font-size: 24px;
}

</style>